package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.ZhuanjiaBiandongDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 专家变动详情Mapper接口
 * 
 * @author ruoyi
 * @date 2022-12-08
 */
@Mapper
public interface ZhuanjiaBiandongDetailMapper 
{
    /**
     * 查询专家变动详情
     * 
     * @param id 专家变动详情主键
     * @return 专家变动详情
     */
    public ZhuanjiaBiandongDetail selectZhuanjiaBiandongDetailById(String id);

    /**
     * 查询专家变动详情列表
     * 
     * @param zhuanjiaBiandongDetail 专家变动详情
     * @return 专家变动详情集合
     */
    public List<ZhuanjiaBiandongDetail> selectZhuanjiaBiandongDetailList(ZhuanjiaBiandongDetail zhuanjiaBiandongDetail);

    /**
     * 查找专家在截止时间前或批次结束时间前未使用的专家变动
     *
     * @param zhuanjiaId 专家ID
     * @param used
     * @param tongguo
     * @param jieshuTime
     * @return
     */
    List<ZhuanjiaBiandongDetail> selectZhuanjiaBiandongDetailListByZhuanjiaIdAndDeptIdAndUsedAndTongguoOrJieshuTime(@Param("zhuanjiaId") String zhuanjiaId, @Param("deptId") String deptId, @Param("used") String used, @Param("tongguo") String tongguo, @Param("jieshuTime") String jieshuTime, @Param("piciEnd") String piciEnd);

    /**
     *
     * @param deptId
     * @param used
     * @param tongguo
     * @param jieshuTime
     * @return
     */
    List<ZhuanjiaBiandongDetail> selectAllByDeptIdAndUsedAndTongguoOrJieshuTime(@Param("deptId") String deptId, @Param("used") String used, @Param("tongguo") String tongguo, @Param("jieshuTime") String jieshuTime);
    /**
     * 新增专家变动详情
     * 
     * @param zhuanjiaBiandongDetail 专家变动详情
     * @return 结果
     */
    public int insertZhuanjiaBiandongDetail(ZhuanjiaBiandongDetail zhuanjiaBiandongDetail);

    /**
     * 修改专家变动详情
     * 
     * @param zhuanjiaBiandongDetail 专家变动详情
     * @return 结果
     */
    public int updateZhuanjiaBiandongDetail(ZhuanjiaBiandongDetail zhuanjiaBiandongDetail);

    /**
     * 删除专家变动详情
     *
     * @param id 专家变动详情主键
     * @return 结果
     */
    public int deleteZhuanjiaBiandongDetailById(String id);

    /**
     * 批量删除专家变动详情
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteZhuanjiaBiandongDetailByIds(String[] ids);

    /**
     * 查询专家变动详情列表custom
     *
     * @return 专家变动详情集合
     */
    public List<Map<String,Object>>selectZhuanjiaBiandongDetailListCustom(@Param("deptid") String ppDeptId,@Param("zhuanjiamingcheng") String ppZhuanjiamingcheng,@Param("biandongleixing") String ppBiandongleixing,@Param("biandongriqi") String ppBiandongriqi,@Param("startindex")int ppStartIndex,@Param("pagesize")int ppPageSize);

    int countZhuanjiaBiandongDetailListCustom(@Param("deptid") String ppDeptId,@Param("zhuanjiamingcheng") String ppZhuanjiamingcheng,@Param("biandongleixing") String ppBiandongleixing,@Param("biandongriqi") String ppBiandongriqi);

    public List<Map<String,Object>> existBiandongByZhuanjiaIdAndBeizhu1(@Param("zhuanjiaid")String ppZhuanjiaId);

    /**
     * 专家管理-当批次专家变动状态管理-历史专家变动查询-列表
     */
    public List<Map<String,Object>> lishizhuanjiabiandongList(@Param("deptid") String ppDeptId,@Param("zhuanjiamingcheng") String ppZhuanjiamingcheng,
                                                              @Param("biandongleixing") String ppBiandongleixing,@Param("biandongriqi") String ppBiandongriqi,
                                                              @Param("danweimingcheng") String danweimingcheng,@Param("cengji") String cengji,
                                                              @Param("startindex")int ppStartIndex,@Param("pagesize")int ppPageSize);

    int lishizhuanjiabiandongListCount(@Param("deptid") String ppDeptId,@Param("zhuanjiamingcheng") String ppZhuanjiamingcheng,
                                       @Param("biandongleixing") String ppBiandongleixing,@Param("biandongriqi") String ppBiandongriqi,
                                       @Param("danweimingcheng") String danweimingcheng,@Param("cengji") String cengji);

}
